<template>
    <el-container>
        <el-aside width="auto" class="header-logo tap" >
            <img class="logo" src="@/assets/img/p2c.png" alt="Logo" />
            <p class="top-title-text">鑫海融达渤海P2C后台</p>
        </el-aside>
        <el-aside width="auto" class="header-logo tap admin-top-logo" >
            <el-avatar icon="el-icon-user-solid" class="headerLogo">
            </el-avatar>
            <p>超级管理员</p>
        </el-aside>
        <el-button type="primary" class="log-out" @click="logOut()">退出登录</el-button>
    </el-container>
</template>


<script>
    export default {
        name: "Nav-top",
        data() {
            return {
                activeIndex: "1",
            };
        },
        methods: {
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            },
            logOut(){
                localStorage.removeItem("token")
                this.$router.push({path:'/login',query:{}})
            }
        }
    }
</script>

<style scoped>
    .el-aside {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    section{
        height: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
    }

    .logo {
        width:4rem;
        cursor: pointer;
    }

    .headerLogo{
        cursor: pointer;
        margin-right: 0.5rem;
    }
    .admin-top-logo{
        position: fixed;
        right: 13rem;
    }
    .top-title-text{
        font-family: cursive;
        font-size: 1.5rem;
        margin-left: 1.1rem;
    }
    .log-out{
        position: absolute;
        right: 6rem;
    }
</style>
